<template>
  <div class="list-wrapper">
    <div v-for="(item, index) of list" :key="index" class="item-wrapper" @click="$router.push({path: `/item-detail/${item.commodity_id}`, query: {isSpell: 1}})">
      <cluster-item-panel :item="item" />
    </div>
  </div>
</template>
<script>
import ClusterItemPanel from "@/views/mall/component/cluster-item-panel";
import { getClusterList } from "@/api/seckill";
const ERR_OK = 200;
export default {
  components: {
    ClusterItemPanel
  },
  data() {
    return {
      list: []
    };
  },
  created() {
    this._getClusterList();
  },
  methods: {
    _getClusterList() {
      getClusterList().then(res => {
        if (res.data.code === ERR_OK) {
          this.list = res.data.data.list;
        }
      });
    }
  }
};
</script>
<style lang="less" scoped>
.list-wrapper{
	padding: 0.4rem;
	box-sizing: border-box;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	.item-wrapper{
		margin-bottom: 0.3rem;
	}
}
</style>